<template>
  <div>
    <p>This is a input 组件</p>

    <el-button type="success" @click="add">传值</el-button>

    <el-button type="warning" @click="close">测试</el-button>

    <div v-for="(i, index) in list" :key="index">
      {{ i.name }}

    </div>

    <div v-for="(i, index) in list2" :key="index">
      {{ i.name }}
    </div>



  </div>
</template>

<script setup>

import { reactive, ref } from "vue";


// 接收父组件传过来的值
const props = defineProps({
  list: '',
  list2: ''
})



// 子向父传值，绑定事件
const emit = defineEmits();

const add = () => {

  emit('add', 222222)

}



const close = () => {

  emit('close', "测试传值")

}


</script>